<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>通讯录</title>
</head>
<body style="font-family: Arial; font-size: smaller;">
    <div align="center">
        <br>
        <h1>通讯录</h1>
        <form action="search.html" method="post">
            <table style="border-collapse: collapse;" border="0" bordercolor="#006699" width="500">
                <tr>
                    <td>输入用户名查询（模糊）</td>
                    <td><input type="text" name="name"/>
                        <input type="submit" value="查询"/>
                        <input type="button" value="新建联系人" onclick="window.location='save.html'"/>
                    </td></tr>
            </table>
        </form>
        <br><br>
        <table style="border-collapse: collapse;" border="1" bordercolor="#006699" width="500">
            <tr bgcolor="lightblue">
                <th>编号</th>
                <th>名字</th>
                <th>地址</th>
                <th>手机</th>
                <th>操作</th>
            </tr>
            <#if (contacts?size==0)>
                <tr>
                    <td colspan="5" align="center">No Results found</td>
                </tr>
            <#else>
                <#list contacts as contact>
                    <tr>
                        <td>${contact.id}</td>
                        <td>${contact.name}</td>
                        <td>${contact.address}</td>
                        <td>${contact.mobile?c}</td>
                        <td>
                            <a href="update.html?id=${contact.id}">编辑</a>
                            <a href="delete.html?id=${contact.id}">删除</a>
                        </td>
                    </tr>
                </#list>
            </#if>
        </table>
    </div>
</body>
</html>